This page last changed on May 31, 2006 by tcarlson.

Quick Links

Mule transports are used to deliver soap requests between Axis clients and Axis services hosted by Mule. This means you can easily use jms, vm, smtp even xmpp (jabber) to send soap requests. The following describes how to configure each one.

Soap over Jms

First you'll need to add a Jms connector to your Mule Xml configuration -

<connector name="jmsConnector" className="org.mule.providers.jms.JmsConnector">
    <properties>
        <property name="connectionFactoryJndiName" value="ConnectionFactory"/>
        <property name="jndiInitialFactory" value="org.activemq.jndi.ActiveMQInitialContextFactory"/>
        <property name="specification" value="1.1"/>
	<map name="connectionFactoryProperties">
	    <property name="brokerURL" value="tcp://localhost:61616"/>
	</map>
    </properties>
</connector>

Now all you need to do is configure the service endpoint. Here is an example of a client request endpoint over jms -

axis:jms://soap.echo.queue?method=echo&param=hello

The_soap.echo.queue_ is the queue on which the soap request will be sent and the method is the operation to invoke.

To expose a Mule service as a soap service over jms you add an inbound endpoint to the component -

<mule-descriptor name="echoComponent"
    implementation="org.mule.components.simple.EchoComponent">
    <inbound-router>
        <endpoint address="axis:jms://soap.echo.queue"/>
    </inbound-router>
</mule-descriptor>

You can configure the Jms soap endping the same way you configure a normal Jms endpoint so that all QoS and transaction options are supported. See the Jms Provider documentation for a full description.

Soap over VM

Soap over Mule's Vm transport is also supported. This can be usful for testing or prototyping. The endpoints are configured in the exact same way as Jms soap endpoints. For a client to invoke a service using VM -

axis:vm://echoComponent?method=echo&param=hello

And to expose the service over the Vm transport -

<mule-descriptor name="echoComponent"
    implementation="org.mule.components.simple.EchoComponent">
    <inbound-router>
        <endpoint address="axis:vm://echoComponent"/>
    </inbound-router>
</mule-descriptor>

Binding to a Servlet Container

In you embed Mule in a webapp you might want to bind Axis services to the Servlet container port rather than open another port for Mule Soap services - you may not be able to do this due to firewall restrictions. In this scenario you can use the Mule Servlet Transport and Axis instead of http. To do this you need to add the MuleReceiverServlet to your web.xml -

<servlet>
    <servlet-name>muleServlet</servlet-name>
    <servlet-class>org.mule.providers.http.servlet.MuleReceiverServlet</servlet-class>
    <load-on-startup/>
</servlet>

<servlet-mapping>
    <servlet-name>muleServlet</servlet-name>
    <url-pattern>/mule/services/*</url-pattern>
</servlet-mapping>

Next you need to add a servlet endpoint to your component -

<mule-descriptor name="TestService"
    implementation="org.mule.providers.soap.TestServiceComponent">
    <inbound-router>
        <endpoint address="axis:servlet://TestService"/>
    </inbound-router>
</mule-descriptor>

Note that there is not host or port information on the endpoint, Just the component name. The host, port and path is dictated by the servlet container and the url-pattern of the MuleReceiverServlet. If The servlet container was listening on port 8080 the URL to invoke the service would be -

http://localhost:8080/mule/services/TestService

Using other Mule transports

There is no reason why other transports such as smtp or even xmpp couldn't be used to send and receive soap requests. The notation for configuring the endpoint to be used by Axis is to configure the endpoint according to the endpoint scheme and then prepend the axis: scheme. For client endpoints the method param must be set also.

//Client
axis:xmpp://mule1:[email protected]/axis?method=echo&param=hello

//Server
axis:xmpp://mule1:[email protected]/axis
Document generated by Confluence on Nov 27, 2006 10:27